#pragma once
#include<iostream>
using namespace std;
struct tree_node
{
	typedef tree_node node;
	int _val;
	node* _left = nullptr;
	node* _right = nullptr;
	tree_node(int val):
		_val(val){}
};
int count;
class tree
{
	typedef tree_node node;
	node* _root = nullptr;
public:
	tree()
	{
		node* h = new node(1);
		node* h1 = new node(2);
		node* h2 = new node(2);
		node* h3 = new node(2);
		node* h4 = new node(2);
		h->_left = h1;
		h->_right = h2;
		h1->_left = h3;
		h1->_right = h4;
		_root = h;


	}
	void _pre(node* root)
	{
		if (!root) return;
		cout << root->_val << ++::count<<endl;
		_pre(root->_left);
		_pre(root->_right);
	}
	void pre()
	{
		_pre(_root);
	}
};
